<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>ESC/P2</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="The Developer's Guide to Gutenprint"
HREF="book1.html"><LINK
REL="PREVIOUS"
TITLE="The driver file"
HREF="x271.html"><LINK
REL="NEXT"
TITLE="Remote Mode Commands"
HREF="x955.html"><META
http-equiv="Content-Type"
content="text/html; charset=@encoding@"></HEAD
><BODY
CLASS="chapter"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Developer's Guide to Gutenprint</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x271.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x955.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="chapter"
><H1
><A
NAME="AEN464"
></A
>Chapter 5. ESC/P2</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="c464.html#AEN477"
>Standard commands</A
></DT
><DT
><A
HREF="x955.html"
>Remote Mode Commands</A
></DT
><DT
><A
HREF="x1669.html"
>Appropriate Remote Commands</A
></DT
></DL
></DIV
><P
>&#13;    This is a description of the ESC/P2 raster commands used by the
    Gutenprint printer driver, which is a subset of the complete
    command set.  The full documents are found on <A
HREF="http://www.ercipd.com/isv/edr_docs.htm"
TARGET="_top"
>&#13;    <I
CLASS="citetitle"
>http://www.ercipd.com/isv/edr_docs.htm</I
></A
>.
    Note that these are <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>not</I
></SPAN
> always correct, and
    are certainly not complete.
  </P
><P
>&#13;    All ESCP/2 raster commands begin with the <TT
CLASS="literal"
>ESC</TT
>
    character (0x1b), followed by either one or two command characters
    and arguments where applicable.  Older commands generally have one
    command character.  Newer commands usually have a
    ‘<TT
CLASS="literal"
>(</TT
>’ (left parenthesis) followed by
    a command character and a byte count for the arguments that
    follow.  The byte count is a 16-bit (2 byte) binary integer, in
    little endian order.
  </P
><P
>&#13;    All arguments listed here are of the form
    <TT
CLASS="literal"
>name[bytes]</TT
> where <TT
CLASS="literal"
>[bytes]</TT
> is
    the number of bytes that comprise the argument.  The arguments
    themselves are usually one, two, or four byte integers, always
    little endian (the least significant bits come first).  Presumably
    this is to match Intel processors.
  </P
><P
>&#13;    In some cases, the same command sequence identifies different
    versions of the same command, depending upon the number of bytes
    of arguments.
  </P
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="AEN477"
>Standard commands</A
></H1
><P
></P
><DIV
CLASS="variablelist"
><P
><B
>ESC/P2 Commands</B
></P
><DL
><DT
><TT
CLASS="literal"
>ESC @</TT
></DT
><DD
><P
>&#13;            Reset the printer.  Discards any output, ejects the
            existing page, returns all settings to their default.
            Always use this before printing a page.
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC (G <CODE
CLASS="varname"
>BC</CODE
>=1
            <CODE
CLASS="varname"
>ON1</CODE
></TT
></DT
><DD
><P
>&#13;            Turn on graphics mode.  <CODE
CLASS="varname"
>ON</CODE
> should be
            <CODE
CLASS="constant"
>1</CODE
> (turn on graphics mode).
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC (U <CODE
CLASS="varname"
>BC</CODE
>=1
            <CODE
CLASS="varname"
>UNIT1</CODE
></TT
></DT
><DD
><P
>&#13;            Set basic unit of measurement used by printer.  This is
            expressed in multiples of 1/3600".  At 720 DPI,
            <CODE
CLASS="varname"
>UNIT</CODE
> is <CODE
CLASS="constant"
>5</CODE
>; at
            360 DPI, <CODE
CLASS="varname"
>UNIT</CODE
> is
            <CODE
CLASS="constant"
>10</CODE
>.
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC (U <CODE
CLASS="varname"
>BC</CODE
>=5
            <CODE
CLASS="varname"
>PAGEUNITS1</CODE
> <CODE
CLASS="varname"
>VUNIT1</CODE
>
            <CODE
CLASS="varname"
>HUNIT1</CODE
>
            <CODE
CLASS="varname"
>BASEUNIT2</CODE
></TT
></DT
><DD
><P
>&#13;            Set basic units of measurement used by the printer.
            <CODE
CLASS="varname"
>PAGEUNIT</CODE
> is the unit of page
            measurement (for commands that set page dimensions and
            the like).  <CODE
CLASS="varname"
>VUNIT</CODE
> is the unit of
            vertical measurement (for vertical movement commands).
            <CODE
CLASS="varname"
>HUNIT</CODE
> is the unit of horizontal
            movement (for horizontal positioning commands).  All of
            these units are expressed in
            <CODE
CLASS="varname"
>BASEUNIT</CODE
>, which is in reciprocal
            inches.  Typically, <CODE
CLASS="varname"
>BASEUNIT</CODE
> is
            <CODE
CLASS="constant"
>1440</CODE
>.  In 720 DPI mode,
            <CODE
CLASS="varname"
>PAGEUNIT</CODE
>, <CODE
CLASS="varname"
>VUNIT</CODE
>,
            and <CODE
CLASS="varname"
>HUNIT</CODE
> are all
            <CODE
CLASS="constant"
>2</CODE
>; in 1440×720 DPI mode,
            <CODE
CLASS="varname"
>PAGEUNIT</CODE
> and <CODE
CLASS="varname"
>VUNIT</CODE
>
            are normally set to <CODE
CLASS="constant"
>2</CODE
>;
            <CODE
CLASS="varname"
>HUNIT</CODE
> is set to
            <CODE
CLASS="constant"
>1</CODE
>.
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC (K <CODE
CLASS="varname"
>BC</CODE
>=2
            <CODE
CLASS="varname"
>ZERO1</CODE
>
            <CODE
CLASS="varname"
>GRAYMODE1</CODE
></TT
></DT
><DD
><P
>&#13;            Set color or grayscale mode, on printers supporting an
            explicit grayscale mode.  These printers can be
            identified because they are advertised as having more
            black nozzles than nozzles of individual colors.
            Setting grayscale mode allows use of these extra nozzles
            for faster printing.  <CODE
CLASS="varname"
>GRAYMODE</CODE
> should
            be <CODE
CLASS="constant"
>0</CODE
> or <CODE
CLASS="constant"
>2</CODE
> for
            color, <CODE
CLASS="constant"
>1</CODE
> for grayscale.
            <CODE
CLASS="varname"
>ZERO</CODE
> should always be
            <CODE
CLASS="constant"
>0</CODE
>.
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC (i <CODE
CLASS="varname"
>BC</CODE
>=1
            <CODE
CLASS="varname"
>MICROWEAVE1</CODE
></TT
></DT
><DD
><P
>&#13;            If <CODE
CLASS="varname"
>MICROWEAVE</CODE
> is
            <CODE
CLASS="constant"
>1</CODE
>, use microweave mode.  On older
            printers, this is used to turn on microweave; on newer
            printers, it prints one row at a time.  All printers
            support this mode.  It should only be used at 720 (or
            1440×720) DPI.  The Epson Stylus Pro series
            indicates additional modes:
          </P
><P
></P
><DIV
CLASS="variablelist"
><DL
><DT
><CODE
CLASS="constant"
>2</CODE
></DT
><DD
><P
>&#13;                  “Full-overlap”
                </P
></DD
><DT
><CODE
CLASS="constant"
>3</CODE
></DT
><DD
><P
>&#13;                  “Four-pass”
                </P
></DD
><DT
><CODE
CLASS="constant"
>4</CODE
></DT
><DD
><P
>&#13;                  “Full-overlap 2”
                </P
></DD
></DL
></DIV
><P
>&#13;            Any of these commands can be used with the high four
            bits set to either <CODE
CLASS="constant"
>3</CODE
> or
            <CODE
CLASS="constant"
>0</CODE
>.
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC U
            <CODE
CLASS="varname"
>DIRECTION1</CODE
></TT
></DT
><DD
><P
>&#13;            If <CODE
CLASS="varname"
>DIRECTION</CODE
> is
            <CODE
CLASS="constant"
>1</CODE
>, print unidirectionally; if
            <CODE
CLASS="constant"
>0</CODE
>, print bidirectionally.
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC (s <CODE
CLASS="varname"
>BC</CODE
>=1
            <CODE
CLASS="varname"
>SPEED1</CODE
></TT
></DT
><DD
><P
>&#13;            On some older printers, this controls the print head
            speed.  <CODE
CLASS="varname"
>SPEED</CODE
> of
            <CODE
CLASS="constant"
>2</CODE
> is 10 inches/sec;
            <CODE
CLASS="varname"
>SPEED</CODE
> of <CODE
CLASS="constant"
>0</CODE
> or 1
            is 20.
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC (e <CODE
CLASS="varname"
>BC</CODE
>=2
            <CODE
CLASS="varname"
>ZERO1</CODE
>
            <CODE
CLASS="varname"
>DOTSIZE1</CODE
></TT
></DT
><DD
><P
>&#13;            Choose print dotsize.  <CODE
CLASS="varname"
>DOTSIZE</CODE
> can
            take on various values, depending upon the printer.
            Almost all printers support <CODE
CLASS="constant"
>0</CODE
> and
            <CODE
CLASS="constant"
>2</CODE
>.  Variable dot size printers
            allow a value of <CODE
CLASS="varname"
>16</CODE
>.  Other than the
            value of <CODE
CLASS="varname"
>16</CODE
>, this appears to be
            ignored at resolutions of 720 DPI and above.
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC (C <CODE
CLASS="varname"
>BC</CODE
>=2
            <CODE
CLASS="varname"
>PAGELENGTH2</CODE
></TT
>, <TT
CLASS="literal"
>ESC (C <CODE
CLASS="varname"
>BC</CODE
>=4
            <CODE
CLASS="varname"
>PAGELENGTH4</CODE
></TT
></DT
><DD
><P
>&#13;            Set the length of the page in “pageunits”
            (see <TT
CLASS="literal"
>ESC (U</TT
> above).  The second form
            of the command allows setting of longer page lengths on
            new printers (these happen to be the printers that
            support variable dot size).
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC (c <CODE
CLASS="varname"
>BC</CODE
>=4
            <CODE
CLASS="varname"
>TOP2</CODE
>
            <CODE
CLASS="varname"
>LENGTH2</CODE
></TT
>, <TT
CLASS="literal"
>ESC (c <CODE
CLASS="varname"
>BC</CODE
>=8
            <CODE
CLASS="varname"
>TOP4</CODE
>
            <CODE
CLASS="varname"
>LENGTH4</CODE
></TT
></DT
><DD
><P
>&#13;            Set the vertical page margins of the page in
            “pageunits” (see <TT
CLASS="literal"
>ESC (U</TT
>
            above).  The margins are specified as the top of the
            page and the length of the page.  The second form of the
            command allows setting of longer page lengths on new
            printers (these happen to be the printers that support
            variable dot size).
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC (S <CODE
CLASS="varname"
>BC</CODE
>=8
            <CODE
CLASS="varname"
>WIDTH4</CODE
>
            <CODE
CLASS="varname"
>LENGTH4</CODE
></TT
></DT
><DD
><P
>&#13;            Set the width and length of the printed page region in
            “pageunits” (see <TT
CLASS="literal"
>ESC (U</TT
>
            above).
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC (v <CODE
CLASS="varname"
>BC</CODE
>=2
            <CODE
CLASS="varname"
>ADVANCE2</CODE
></TT
>, <TT
CLASS="literal"
>ESC (v <CODE
CLASS="varname"
>BC</CODE
>=4
            <CODE
CLASS="varname"
>ADVANCE4</CODE
></TT
></DT
><DD
><P
>&#13;            Feed vertically <CODE
CLASS="varname"
>ADVANCE</CODE
>
            “vertical units” (see <TT
CLASS="literal"
>ESC
            (U</TT
> above) from the current print head
            position.
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC (V <CODE
CLASS="varname"
>BC</CODE
>=2
            <CODE
CLASS="varname"
>ADVANCE2</CODE
></TT
>, <TT
CLASS="literal"
>ESC (V <CODE
CLASS="varname"
>BC</CODE
>=4
            <CODE
CLASS="varname"
>ADVANCE4</CODE
></TT
></DT
><DD
><P
>&#13;            Feed vertically <CODE
CLASS="varname"
>ADVANCE</CODE
>
            “vertical units” (see <TT
CLASS="literal"
>ESC
            (U</TT
> above) from the top margin.
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC ($ <CODE
CLASS="varname"
>BC</CODE
>=4
            <CODE
CLASS="varname"
>OFFSET4</CODE
></TT
></DT
><DD
><P
>&#13;            Set horizontal position to <CODE
CLASS="varname"
>OFFSET</CODE
>
            from the left margin.  This command operates on printers
            of the 740 class and newer (all printers with variable
            dot size).
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC $
            <CODE
CLASS="varname"
>OFFSET2</CODE
></TT
></DT
><DD
><P
>&#13;            Set horizontal position to <CODE
CLASS="varname"
>OFFSET</CODE
>
            from the left margin.  This command operates on printers
            of the 740 class and newer (all printers with variable
            dot size).
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC (\ <CODE
CLASS="varname"
>BC</CODE
>=4
            <CODE
CLASS="varname"
>UNITS2</CODE
>
            <CODE
CLASS="varname"
>OFFSET2</CODE
></TT
></DT
><DD
><P
>&#13;            Set horizontal position to <CODE
CLASS="varname"
>OFFSET</CODE
>
            from the previous print head position, measured in
            <CODE
CLASS="varname"
>UNITS</CODE
>.  <CODE
CLASS="varname"
>UNITS</CODE
> is
            measured in inverse inches, and should be set to 1440 in
            all cases.  This operates on all 1440 dpi printers that
            do not support variable dot size.
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC (/ <CODE
CLASS="varname"
>BC</CODE
>=4
            <CODE
CLASS="varname"
>OFFSET4</CODE
></TT
></DT
><DD
><P
>&#13;            Set horizontal position to <CODE
CLASS="varname"
>OFFSET</CODE
>
            from the previous print head position, measured in
            “horizontal units” (see <TT
CLASS="literal"
>ESC
            (U</TT
> above).  This operates on all variable dot
            size printers.
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC \
            <CODE
CLASS="varname"
>OFFSET2</CODE
></TT
></DT
><DD
><P
>&#13;            Set horizontal position to <CODE
CLASS="varname"
>OFFSET</CODE
>
            from the previous print head position, measured in basic
            unit of measurement (see <TT
CLASS="literal"
>ESC (U</TT
>
            above). This is used on all 720 dpi printers, and can
            also be used on 1440 dpi printers in lower resolutions
            to save a few bytes.  Note that
            <CODE
CLASS="varname"
>OFFSET</CODE
> may be negative.  The range of
            values for this command is between
            <CODE
CLASS="constant"
>-16384</CODE
> and
            <CODE
CLASS="constant"
>16383</CODE
>.
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC r
            <CODE
CLASS="varname"
>COLOR1</CODE
></TT
>, <TT
CLASS="literal"
>ESC (r <CODE
CLASS="varname"
>BC</CODE
>=2
            <CODE
CLASS="varname"
>DENSITY1</CODE
>
            <CODE
CLASS="varname"
>COLOR1</CODE
></TT
></DT
><DD
><P
>&#13;            Set the ink color.  The first form is used on four-color
            printers; the second on six-color printers.
            <CODE
CLASS="varname"
>DENSITY</CODE
> is <CODE
CLASS="constant"
>0</CODE
> for
            dark inks, <CODE
CLASS="constant"
>1</CODE
> for light.
            <CODE
CLASS="varname"
>COLOR</CODE
> is
          </P
><DIV
CLASS="table"
><A
NAME="AEN728"
></A
><P
><B
>Table 5-1. Colors</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL
WIDTH="1*"
TITLE="id"><COL
WIDTH="1*"
TITLE="color"><THEAD
><TR
><TH
><CODE
CLASS="varname"
>COLOR</CODE
></TH
><TH
>Color name</TH
></TR
></THEAD
><TBODY
><TR
><TD
><CODE
CLASS="constant"
>0</CODE
></TD
><TD
>Black</TD
></TR
><TR
><TD
><CODE
CLASS="constant"
>1</CODE
></TD
><TD
>Magenta</TD
></TR
><TR
><TD
><CODE
CLASS="constant"
>2</CODE
></TD
><TD
>Cyan</TD
></TR
><TR
><TD
><CODE
CLASS="constant"
>4</CODE
></TD
><TD
>Yellow</TD
></TR
></TBODY
></TABLE
></DIV
><P
>&#13;            This command is not used on variable dot size printers
            in softweave mode.
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC . <CODE
CLASS="varname"
>COMPRESS1</CODE
>
            <CODE
CLASS="varname"
>VSEP1</CODE
> <CODE
CLASS="varname"
>HSEP1</CODE
>
            <CODE
CLASS="varname"
>LINES1</CODE
> <CODE
CLASS="varname"
>WIDTH2</CODE
>
            data...</TT
></DT
><DD
><P
>&#13;            Print data.  <CODE
CLASS="varname"
>COMPRESS</CODE
> signifies the
            compression mode.
          </P
><DIV
CLASS="table"
><A
NAME="AEN767"
></A
><P
><B
>Table 5-2. Compression modes</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL
WIDTH="1*"
TITLE="id"><COL
WIDTH="1*"
TITLE="compression"><THEAD
><TR
><TH
><CODE
CLASS="varname"
>COMPRESS</CODE
></TH
><TH
>Compression mode</TH
></TR
></THEAD
><TBODY
><TR
><TD
><CODE
CLASS="constant"
>0</CODE
></TD
><TD
>No compression</TD
></TR
><TR
><TD
><CODE
CLASS="constant"
>1</CODE
></TD
><TD
>&#13;                    TIFF compression (incorrectly documented as
                    “run length encoded”)
                  </TD
></TR
><TR
><TD
><CODE
CLASS="constant"
>2</CODE
></TD
><TD
>&#13;                    TIFF compression with a special command set.
                  </TD
></TR
></TBODY
></TABLE
></DIV
><P
>&#13;            <CODE
CLASS="varname"
>VSEP</CODE
> depends upon resolution and
            printer type.  At 360 DPI, it is always
            <CODE
CLASS="constant"
>10</CODE
>.  At 720 DPI, it is normally
            <CODE
CLASS="constant"
>5</CODE
>5.  On the ESC 600, it is
            <CODE
CLASS="constant"
>40</CODE
> (8 × 5}).  On some other
            printers, it varies.
          </P
><P
>&#13;            <CODE
CLASS="varname"
>HSEP1</CODE
> is <CODE
CLASS="constant"
>10</CODE
> at
            360 DPI and <CODE
CLASS="constant"
>5</CODE
> at 720 or 1440 DPI
            (1440 DPI cannot be printed in one pass; it is printed
            in two passes, with the dots separated in each pass by
            1/720").
          </P
><P
>&#13;            <CODE
CLASS="varname"
>LINES</CODE
> is the number of lines to be
            printed.  It should be <CODE
CLASS="constant"
>1</CODE
> in
            microweave and 360 DPI.  At 720 DPI softweave, it should
            be the number of lines to be actually printed.
          </P
><P
>&#13;            <CODE
CLASS="varname"
>WIDTH</CODE
> is the number of pixels to be
            printed in each row.  Following this command, a carriage
            return (<CODE
CLASS="constant"
>13</CODE
> decimal,
            <TT
CLASS="literal"
>0A</TT
> hex) should be output to return
            the print head position to the left margin.
          </P
><P
>&#13;            The basic data format is a string of bytes, with data
            from left to right on the page.  Within each byte, the
            highest bit is first.
          </P
><P
>&#13;            The TIFF compression is implemented as one count byte
            followed by one or more data bytes.  There are two
            cases:
          </P
><P
></P
><OL
TYPE="1"
><LI
><P
>&#13;                If the count byte is <CODE
CLASS="constant"
>128</CODE
> or
                less, it is followed by ([count] + 1) data bytes.
                So if the count byte is <CODE
CLASS="constant"
>0</CODE
>, it
                is followed by 1 data byte; if it is
                <CODE
CLASS="constant"
>128</CODE
>, it is followed by 129 data
                bytes.
              </P
></LI
><LI
><P
>&#13;                If the count byte is greater than 128, it is
                followed by one byte.  This byte is repeated (257 -
                [count]) times.  So if [count] is 129, the next byte
                is treated as though it were repeated 128 times; if
                [count] is 255, it is treated as though it were
                repeated twice.
              </P
></LI
></OL
></DD
><DT
><TT
CLASS="literal"
>ESC i <CODE
CLASS="varname"
>COLOR1</CODE
>
            <CODE
CLASS="varname"
>COMPRESS1</CODE
> <CODE
CLASS="varname"
>BITS1</CODE
>
            <CODE
CLASS="varname"
>BYTES2</CODE
> <CODE
CLASS="varname"
>LINES2</CODE
>
            data...</TT
></DT
><DD
><P
>&#13;            Print data in the newer printers (that support variable
            dot size), and Stylus Pro models.
            <CODE
CLASS="varname"
>COLOR</CODE
> is the color.
          </P
><DIV
CLASS="table"
><A
NAME="AEN827"
></A
><P
><B
>Table 5-3. Extended Colors</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL
WIDTH="1*"
TITLE="id"><COL
WIDTH="1*"
TITLE="color"><THEAD
><TR
><TH
><CODE
CLASS="varname"
>COLOR</CODE
></TH
><TH
>Color name</TH
></TR
></THEAD
><TBODY
><TR
><TD
><CODE
CLASS="constant"
>0</CODE
></TD
><TD
>Black</TD
></TR
><TR
><TD
><CODE
CLASS="constant"
>1</CODE
></TD
><TD
>Magenta</TD
></TR
><TR
><TD
><CODE
CLASS="constant"
>2</CODE
></TD
><TD
>Cyan</TD
></TR
><TR
><TD
><CODE
CLASS="constant"
>4</CODE
></TD
><TD
>Yellow</TD
></TR
><TR
><TD
><CODE
CLASS="constant"
>5</CODE
></TD
><TD
>Alternate black (Stylus C70/C80)</TD
></TR
><TR
><TD
><CODE
CLASS="constant"
>6</CODE
></TD
><TD
>Alternate black (Stylus C70/C80)</TD
></TR
><TR
><TD
><CODE
CLASS="constant"
>16</CODE
></TD
><TD
>Gray (“light black”)</TD
></TR
><TR
><TD
><CODE
CLASS="constant"
>17</CODE
></TD
><TD
>Light magenta</TD
></TR
><TR
><TD
><CODE
CLASS="constant"
>18</CODE
></TD
><TD
>Light cyan</TD
></TR
></TBODY
></TABLE
></DIV
><P
>&#13;            <CODE
CLASS="varname"
>COMPRESS</CODE
> signifies the compression
            mode:
          </P
><DIV
CLASS="table"
><A
NAME="AEN876"
></A
><P
><B
>Table 5-4. Compression modes</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL
WIDTH="1*"
TITLE="id"><COL
WIDTH="1*"
TITLE="compression"><THEAD
><TR
><TH
><CODE
CLASS="varname"
>COMPRESS</CODE
></TH
><TH
>Compression mode</TH
></TR
></THEAD
><TBODY
><TR
><TD
><CODE
CLASS="constant"
>0</CODE
></TD
><TD
>No compression</TD
></TR
><TR
><TD
><CODE
CLASS="constant"
>1</CODE
></TD
><TD
>&#13;                    TIFF compression (incorrectly documented as
                    “run length encoded”)
                  </TD
></TR
><TR
><TD
><CODE
CLASS="constant"
>2</CODE
></TD
><TD
>&#13;                    TIFF compression with a special command set, or
                    “run length encoding 2” on some
                    printers.
                  </TD
></TR
></TBODY
></TABLE
></DIV
><P
>&#13;            <CODE
CLASS="varname"
>BITS</CODE
> is the number of bits per pixel.
          </P
><P
>&#13;            <CODE
CLASS="varname"
>BYTES</CODE
> is the number of bytes wide for
            each row (ceiling(BITS × width_of_row, 8)}). Note
            that this is different from the <TT
CLASS="literal"
>ESC .</TT
>
            command above.
          </P
><P
>&#13;            <CODE
CLASS="varname"
>LINES</CODE
> is the number of lines to be
            printed.  This command is the only way to get variable
            dot size printing.  In variable dot mode, the size of
            the dots increases as the value (<CODE
CLASS="constant"
>1</CODE
>,
            <CODE
CLASS="constant"
>2</CODE
>, or <CODE
CLASS="constant"
>3</CODE
>)
            increases.
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC (D <CODE
CLASS="varname"
>BC</CODE
>=4
            <CODE
CLASS="varname"
>BASE2</CODE
> <CODE
CLASS="varname"
>VERTICAL1</CODE
>
            <CODE
CLASS="varname"
>HORIZONTAL1</CODE
></TT
></DT
><DD
><P
>&#13;            Set printer horizontal and vertical spacing.  It only
            applies to variable dot size printers in softweave mode
            (and possibly other high end printers).
          </P
><P
>&#13;            <CODE
CLASS="varname"
>BASE</CODE
> is the base unit for this
            command; it must be <CODE
CLASS="constant"
>14400</CODE
>.
          </P
><P
>&#13;            <CODE
CLASS="varname"
>VERTICAL</CODE
> is the distance in these
            units between printed rows; it should be
            ((separation_in_nozzles × <CODE
CLASS="varname"
>BASE</CODE
>
            ÷ 720).
          </P
><P
>&#13;            <CODE
CLASS="varname"
>HORIZONTAL</CODE
> is the horizontal
            separation between dots in a row.  Depending upon the
            printer, this should be either (14400 ÷ 720) or
            (14400 ÷ 360).  The Stylus Pro 9000 manual
            suggests that the settings should match the chosen
            resolution, but that is apparently not the case (or not
            always the case) on other printers.
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC (R <CODE
CLASS="varname"
>BC</CODE
>=8 00 R E M O T E
            1</TT
></DT
><DD
><P
>&#13;            Enters “remote mode”.  This is a special,
            undocumented command set that is used to set up various
            printer options, such as paper feed tray, and perform
            utility functions such as head cleaning and alignment.
            It does not appear that anything here is actually
            required to make the printer print.  Our best
            understanding of what is in a remote command sequence is
            described in a separate section below.
          </P
></DD
><DT
><TT
CLASS="literal"
>ESC 01 @EJL [sp] ID\r\n</TT
></DT
><DD
><P
>&#13;            Return the printer ID.  This is considered a remote mode
            command, although the syntax is that of a conventional
            command.  This returns the following information:
          </P
><DIV
CLASS="informalexample"
><P
></P
><A
NAME="AEN937"
></A
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>@EJL ID\r
MFG:EPSON;
CMD:ESCPL2,BDC;
MDL:[printer model];
CLS:PRINTER;
DES:EPSON [printer model];
\f</PRE
></TD
></TR
></TABLE
><P
></P
></DIV
><P
>&#13;            After all data has been sent, a form feed byte should be
            sent.
          </P
></DD
></DL
></DIV
><P
>&#13;     All newer Epson printers (STC 440, STP 750) require the
     following command to be sent at least once to enable printing
     at all.  This command specifically takes the printer out of the
     1284.4 packet mode communication protocol and enables normal
     data transfer.  Sending it multiple times is is not harmful, so
     it is normally sent at the beginning of each job:
  </P
><DIV
CLASS="informalexample"
><P
></P
><A
NAME="AEN941"
></A
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>ESC 01@EJL[space]1284.4[newline]@EJL[space][space][space][space]
[space][newline]ESC@</PRE
></TD
></TR
></TABLE
><P
></P
></DIV
><P
>&#13;    The proper sequence of initialization commands is:
  </P
><DIV
CLASS="informalexample"
><P
></P
><A
NAME="AEN944"
></A
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>magic command
ESC @
remote mode if needed
ESC (G
ESC (U
ESC (K (if appropriate)
ESC (i
ESC U (if needed)
ESC (s (if appropriate)
ESC (e
ESC (C
ESC (c
ESC (S
ESC (D (if needed)
ESC (V (optional -- this can be accomplished with ESC (v)</PRE
></TD
></TR
></TABLE
><P
></P
></DIV
><P
>&#13;    For printing, the proper sequence is:
  </P
><DIV
CLASS="informalexample"
><P
></P
><A
NAME="AEN947"
></A
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>ESC (v</PRE
></TD
></TR
></TABLE
><P
></P
></DIV
><P
>&#13;    and repeat for each color:
  </P
><DIV
CLASS="informalexample"
><P
></P
><A
NAME="AEN950"
></A
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>ESC ($ or ESC (\ or ESC \
ESC (r or ESC r (if needed---not used with "ESC i" and not needed if the color
has not changed from the previous printed line)
ESC . or ESC i  ...data... [return] (0A hex)</PRE
></TD
></TR
></TABLE
><P
></P
></DIV
><P
>&#13;    To terminate a page:
  </P
><DIV
CLASS="informalexample"
><P
></P
><A
NAME="AEN953"
></A
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>[formfeed] (0C hex)
ESC @</PRE
></TD
></TR
></TABLE
><P
></P
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x271.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book1.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x955.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>The driver file</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Remote Mode Commands</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>